(save-excursion (search-forward "\n\n" nil 'move) (point)))
;; Fetch or construct what we should use in the `From ' line.
- (setq mail-from (or (mail-fetch-field "Mail-From")
+ (setq mail-from (or (let ((from (mail-fetch-field "Mail-From")))
+ ;; mail-mbox-from (below) returns a
+ ;; string that ends in a newline, but
+ ;; but mail-fetch-field does not, so
+ ;; we append a newline here.
+ (if from
+ (format "%s\n" from)))
(mail-mbox-from)))
;; If the message specifies a coding system, use it.
(goto-char (point-min))
;; Insert the `From ' line.
- (insert mail-from "\n")
+ (insert mail-from)
;; Record the keywords and attributes in our special way.
(insert "X-RMAIL-ATTRIBUTES: " (apply 'string attrs) "\n")
(when keywords